<!-- 菜单组件二次封装 -->
<template>
  <div class="Menu-container">
    <div v-for="item in list" :key="item.sign" @click.stop="handleSign(item)">
      <div v-if="!item.belong">
        <el-menu-item :index="item.sign" v-if="!item.children">
          <el-icon><Icon :type="item.Icon" /></el-icon>
          <span>{{ item.title }}</span>
        </el-menu-item>
        <el-sub-menu :index="item.sign" v-else>
          <template #title>
            <el-icon><Icon :type="item.Icon" /></el-icon>
            <span>{{ item.title }}</span>
          </template>
          <el-menu-item-group>
            <Menu :list="item.children" @handleSign="handleSign"> </Menu>
          </el-menu-item-group>
        </el-sub-menu>
      </div>
    </div>
  </div>
</template>
  
<script setup>
import Menu from "./Menu.vue";
const props = defineProps({
  list: {
    type: Array,
    default: () => ({}),
  },
});
const emit = defineEmits(["handleSign"]);

const handleSign = (data) => {
  emit("handleSign", data);
};
</script>
  
  <style lang="less" scoped>
</style>